Ext.define('App.authorization.user.view.CurrentUserinfoEditor', {
    extend: 'Extend.window.FormWindow',
    alias: 'widget.CurrentUserinfoEditor',
    config: {
        entity: 'entity',
        window: {
            title: '用户信息',
            width: 900,
            height: 520
        }
    },
    defaults: {columnWidth: .33},
    items: [{
        xtype: 'hidden',
        name: 'id'
    }, {
        xtype: 'textfield',
        name: 'username',
        fieldLabel: '帐号',
        allowBlank: false,
        blankText: '帐号字段为必填字段，不能为空！',
        beforeLabelTextTpl: ['<span style="color:red;">*</span>'],
        maxLength: 32, readOnly: true
    }, {
        xtype: 'textfield',
        name: 'password',
        fieldLabel: '密码',
        allowBlank: false,
        blankText: '密码为必填字段，不能为空！',
        beforeLabelTextTpl: ['<span style="color:red;">*</span>'],
        maxLength: 32,
        inputType: 'password'
    }, {
        xtype: 'textfield',
        name: 'name',
        fieldLabel: '姓名',
        maxLength: 32
    }, {
        xtype: 'textfield',
        name: 'chinasoftNumber',
        fieldLabel: '中软工号',
        minLength: 10,
        maxLength: 10,
        allowBlank: false,
        blankText: '中软工号为必填字段，不能为空！',
        beforeLabelTextTpl: ['<span style="color:red;">*</span>'],
        regex: /^\d+$/,
        regexText: '中软工号错误，中软工号为10位数字组成！'
    }, {
        xtype: 'textfield',
        name: 'email',
        fieldLabel: '邮箱',
        maxLength: 128,
        vtype: 'email'
    }, {
        xtype: 'datefield',
        name: 'accountExpiringDate',
        format: 'Y-m-d',
        editable: false,
        fieldLabel: '帐号失效时间',
        allowBlank: false,
        blankText: '帐号失效时间为必填字段，不能为空！',
        readOnly: true
    }, {
        xtype: 'datefield',
        format: 'Y-m-d',
        editable: false,
        name: 'credentialsExpiringDate',
        fieldLabel: '密码失效时间',
        allowBlank: false,
        blankText: '密码失效时间为必填字段，不能为空！',
        readOnly: true
    }, {
        xtype: 'booleancombobox',
        name: 'locked',
        fieldLabel: '帐号锁定',
        allowBlank: false,
        blankText: '帐号锁定为必填字段，不能为空！',
        readOnly: true
    }, {
        xtype: 'booleancombobox',
        name: 'systemuser',
        fieldLabel: '系统用户',
        allowBlank: false,
        blankText: '系统用户为必填字段，不能为空！',
        beforeLabelTextTpl: ['<span style="color:red;">*</span>'],
        readOnly: true
    }, {
        name: 'roles',
        xtype: 'gridfield',
        fieldLabel: '角色配置',
        columnWidth: 1,
        height: 325,
        readOnly: false,
        tbar: {add: {hidden: true}, remove: {hidden: true}},
        columns: [{
            header: '角色名',
            dataIndex: 'name'
        }, {
            header: '描述',
            dataIndex: 'rolename'
        }, {
            header: '创建人',
            dataIndex: 'creator'
        }, {
            xtype: 'cdtcolumn',
            header: '创建时间',
            dataIndex: 'cdt'
        }]
    }]
})
